import request from '../request.js'
import {
	getVerifyUrl,
	loginUrl,
	registerUrl,
	getUserInfoUrl,
	getPayTokenUrl,
	payUrl,
	accountLoginUrl,
	realNameAuthUrl,
	verifyAasswordUrl,
	passwordChangeUrl,
	payPasswordChangeUrl,
	verifyPayPasswordUrl,
	noticeUrl,
	updateNoticeUrl,
	riskTestUrl,
	rechargeUrl,
	getMUrl
} from '../url.js'

export default {
	//余额
	getM:function(data){
		return request({
			url:getMUrl + "/" + data,
			// data
		})
	},
	//充值
	recharge:function(data){
		return request({
			url:rechargeUrl,
			method:'post',
			data
		})
	},
	//获取验证码	
	getVerify: function(data) {
		console.log(data, "封装API")
		return request({
			url: getVerifyUrl + "?phonenumber=" + data,


		})
	},
	//账号登录
	login: function(data) {
		return request({
			url: loginUrl,
			method: 'post',
			data
		})
	},
	//手机号登录
	accountLogin: function(data) {
		return request({
			url: accountLoginUrl,
			method: 'post',
			data
		})
	},
	//注册
	register: function(data) {
		return request({
			url: registerUrl,
			method: 'post',
			data
		})
	},
	//获取个人信息
	getUserInfo: function(data) {
		return request({
			url: getUserInfoUrl + data
		})
	},
	//用户购买【基金或者黄金】时支付
	pay:function(data){
		request({
			url:payUrl,
			method:'post',
			data  //黄金基金定期活期传参不一致,详细参数见接口文档
		})
	},
	//获取支付幂等性token
	getPayToken:function(data){
		return request({
			url:getPayTokenUrl
		})
	},
	//实名认证
	realNameAuth:function(data){
		return request({
			url:realNameAuthUrl,
			method:"post",
			data //{id:int,inCard:string,realName:string}
		})
	},
	//验证原密码
	verifyAassword:function(data){
		return request({
			url:verifyAasswordUrl,
			method:'post',
			data //{id:int,password:string}
		})
	},
	//修改密码
	passwordChange:function(data){
		return request({
			url:passwordChangeUrl,
			method:'post',
			data
		})
	},
	//修改支付密码
	payPasswordChangeUrl:function(data){
		return request({
			url:payPasswordChangeUrl,
			method:'post',
			data
		})
	},
	//验证支付密码
	verifyPayPassword:function(data){
		return request({
			url:verifyPayPasswordUrl,
			method:'post',
			data
		})
	},
	//获取个人中心通知
	notice:function(data){
		return request({
			url:noticeUrl,
			method:'get',
			data //{id:int}
		})
	},
	//更新通知状态
	updateNotice:function(data){
		return request({
			url:updateNoticeUrl,
			// method:'post',
			data //{id:int}  通知的id
		})
	},
	//风险评测
	riskTest:function(data){
		return request({
			url:riskTestUrl,
			// method:'post',
			data
		})
	}
}
